home *** CD-ROM | disk | FTP | other *** search
- ;$VER: Image Descriptor Setup Script 2.1 (10.01.2000)
- ;
-
- (ONERROR (CLEANUP))
-
- ;··· ·· · cleanup · ·· ···
-
- (procedure CLEANUP
- (delete "installerfx/install")
- )
-
-
- ;··· ·· · Installation procedure · ·· ···
-
- (procedure SETUP
-
- (working "\n\n\n\n\nPreparing ...")
- (copyfiles (prompt) (help @copyfiles-help) (source "installerfx/install.iff") (dest "installerfx") (newname "install") (nogauge))
- (run "run <>nil: installerfx/installerfx installerfx/install")
- (run "installerfx/wintofront")
-
- (message
- "\n\n\n"
- #app-name " is MAILWARE\n"
- "(it means You must send me an e-mail)\n\n"
- #app-name " supports GIF format for\n"
- "loading and saving but do not (de)compress it\n"
- "so LZW algorithm is not used here\n\n"
- "If that method of using GIF is illegal too\n"
- "please let me know and GIF support will be removed"
- )
- (set #icon
- (askchoice
- (prompt "\nWhich type of icon you wish to install ?\n")
- (help @askchoice-help)
- (choices
- "pStandard icon"
- "MagicWB icon"
- "NewIcons icon"
- "OS 3.5 icon"
- )
- )
- )
- (set #doc-type
- (askchoice
- (prompt "\nPlease select documentation format.\n")
- (help @askchoice-help)
- (choices
- "pASCII text file"
- "AmigaGuide ® document"
- "HTML document"
- )
- )
- )
- (set #dest
- (askdir
- (prompt ("\nPlease select drawer for main program.\n"))
- (help @askdir-help)
- (default "Work:")
- )
- )
- (set #doc_dest
- (askdir
- (prompt "\nPlease select drawer for documentation files.\n")
- (help @askdir-help)
- (default "HELP:english")
- )
- )
- (message
- "\n\n\n\n\n\n\nInstaller have enough informations now to begin "
- "installation\n\n"
- )
-
- ;··· ·· · Create id2 drawer in ENVARC: · ·· ···
- (working "\n\n\n\n\nCreating " #app-name " drawer in ENV: ...")
- (makedir "ENVARC:ImageDescriptor"
- (prompt "")
- (help @makedir-help)
- )
-
- ;··· ·· · Copy main file · ·· ···
- (working "\n\n\n\n\nCopying " #app-name " executable ...")
- (copyfiles
- (prompt "")
- (source "Program/id2")
- (dest #dest)
- (nogauge)
- )
-
- (set #main_name (tackon #dest "id2"))
- (set #main_icon (tackon #dest "id2.info"))
-
- ;··· ·· · Copy documentation file · ·· ···
- (working "\n\n\n\n\nCopying " #app-name " documentation ...")
- (if
- (= #doc-type "1")
- (
- (copyfiles
- (prompt "")
- (help @copyfiles-help)
- (source "program/id2.guide")
- (dest #doc_dest)
- (newname "id2.guide")
- (nogauge)
- )
- (set #doc_name (tackon #doc_dest "id2.guide"))
- )
- )
- (if
- (= #doc-type "0")
- (
- (copyfiles
- (prompt "")
- (help @copyfiles-help)
- (source "program/id2.txt")
- (dest #doc_dest)
- (newname "id2.txt")
- (nogauge)
- )
- (set #doc_name (tackon #doc_dest "id2.txt"))
- )
- )
- (if
- (= #doc-type "2")
- (
- (copyfiles
- (prompt "")
- (help @copyfiles-help)
- (source "program/id2.html")
- (dest #doc_dest)
- (newname "id2.html")
- (nogauge)
- )
- (set #doc_name (tackon #doc_dest "id2.html"))
- )
- )
-
- ;··· ·· · Copy icon · ·· ···
- (working "\n\n\n\n\nCopying " #app-name " icon ...")
- (if
- (= #icon "0")
- (
- (copyfiles
- (help @copyfiles-help)
- (source "Icons/nor/id2.info")
- (dest #dest)
- (nogauge)
- )
- )
- )
- (if
- (= #icon "1")
- (
- (copyfiles
- (help @copyfiles-help)
- (source "Icons/mwb/id2.info")
- (dest #dest)
- (nogauge)
- )
- )
- )
- (if
- (= #icon "2")
- (
- (copyfiles
- (help @copyfiles-help)
- (source "Icons/new/id2.info")
- (dest #dest)
- (nogauge)
- )
- )
- )
- (if
- (= #icon "3")
- (
- (copyfiles
- (help @copyfiles-help)
- (source "Icons/v35/id2.info")
- (dest #dest)
- (nogauge)
- )
- )
- )
-
- (copyfiles
- (prompt)
- (help @copyfiles-help)
- (source #main_icon)
- (dest "envarc:imagedescriptor")
- (nogauge)
- )
-
- (working "\n\n\n\n\nCreating uninstall information ...")
- (textfile
- (prompt)
- (help @textfile-help)
- (dest "ENVARC:ImageDescriptor/version")
- (append #id_version)
- )
- (textfile
- (prompt)
- (help @textfile-help)
- (dest "ENVARC:ImageDescriptor/unInstall")
- (append "delete <>NIL: ENVARC:ImageDescriptor force all\n")
- (append "delete <>NIL: ENV:ImageDescriptor force all\n")
- (append "delete <>NIL: "#main_name" force\n")
- (append "delete <>NIL: "#main_icon" force\n")
- (append "delete <>NIL: "#doc_name" force\n")
- )
- (working "\n\n\n\n\nRemoving unwanted files ...")
- (CLEANUP)
- (exit "\n\n\n\n\n"
- "Thank you for choosing " #app-name "\nHope you enjoy it."
- "\n\nTo remove it please use this script again"
- (quiet))
- )
-
- ; ··· ·· · Uninstall procedure · ·· ···
-
- (procedure REMOVE
-
- (set #un_standard "envarc:imagedescriptor/uninstall")
- (set #ask_std "0")
-
- (set @user-level 2)
- (set #details (getenv "imagedescriptor/uninstall"))
- (message
- "\n\n\n"
- "Installer has found uninstall information\n"
- "and its ready to remove files.\n\n"
- "Make sure that any of "@app-name" "#ver_actual" files \n"
- "are not in use during uninstall process\n\n"
- "Press HELP for details\n\n"
- (help "Installer has found uninstall information\n"
- "and will perform following AmigaDOS commands:\n\n"
- #details)
- )
-
- (working "\n\n\n\n\nRemoving files ...")
- (execute #un_standard)
- (if
- (= #what_do "1")
-
- (exit "\n\n\n\n\n\n"
- @app-name " " #ver_actual " was succesfully uninstaled."
- "\n\nThank You."
- (quiet)
- ))
- )
- ;··· ·· · Begin of script · ·· ···
-
- (trap CLEANUP)
- (iconinfo
- (prompt)
- (help @iconinfo-help)
- (dest "install")
- (gettooltype "VERSION" "#id_version")
- )
- (set #app-name (cat @app-name " " #id_version))
- (message "\n\n::: :: : Welcome to " #app-name " Setup : :: :::\n"
- "\n\n"
- #app-name " created by\n(c) 2000 Tomasz Malerczyk"
- "\n\n"
- "Please visit\nhttp://www.imagedescriptor.prv.pl/\nfor latest versions !\n"
- "\n"
- "Do you wish to proceed?"
- )
- (if (=(exists "envarc:imagedescriptor/uninstall") 0)
- (SETUP)
- )
- (set #un_version "envarc:imagedescriptor/version")
- (set #ver_actual "2.0")
- (if
- (=(exists "envarc:imagedescriptor/version") 1)
- (set #ver_actual (getenv #un_version))
- )
- (set #un_ask1 (cat "pInstall version "#id_version))
- (set #un_ask2 (cat "Remove version "#ver_actual" and install version "#id_version))
- (set #un_ask3 (cat "Remove version "#ver_actual))
- (set #what_do
- (askchoice
- (prompt
- "Installer found "@app-name" Uninstall information\n"
- "(pre 2.0 versions are not recognized by this script)\n\n"
- "Current version: "#id_version"\n"
- "Installed version: "#ver_actual"\n\n"
- "What you wish to do?\n")
- (help)
- (choices
- #un_ask1
- #un_ask3
- #un_ask2
- )
- (default 1)
- ))
- (if
- (= #what_do "0")
- (
- (SETUP)
- )
- )
- (if
- (= #what_do "2")
- (
- (REMOVE)
- (SETUP)
- )
- )
- (REMOVE)
- (exit (quiet))
- (welcome "thank you")
-